package com.huawei.hms.videoeditor.utils;

import com.blankj.utilcode.util.PermissionUtils;

import stark.common.basic.utils.ResUtil;
import stark.common.basic.utils.StkPermissionHelper;

/**
 * Author：daizhongbin on 2022/10/27
 * Email：1027154338@qq.com
 * Desc:
 */
public class MyPermissionHelper {

    public static void reqStoragePermission(PermissionUtils.SimpleCallback callback) {
        /*String[] permissions = new String[]{
                Manifest.permission.READ_EXTERNAL_STORAGE,
                Manifest.permission.WRITE_EXTERNAL_STORAGE
        };
        PermissionUtils.permission(permissions)
                .callback(callback)
                .request();*/
        StkPermissionHelper.permission(StkPermissionHelper.Permission.ACCESS_IMAGE_VIDEO)
                .reqPermissionDesc(ResUtil.getStr(com.stark.common.res.R.string.req_storage_permission_desc))
                .callback(new StkPermissionHelper.ACallback() {
                    @Override
                    public void onGranted() {
                        if (callback != null) {
                            callback.onGranted();
                        }
                    }
                })
                .request();
    }

}
